//
//  Tools.m
//  Learn
//
//  Created by apple on 2024/4/3.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "Tools.h"

@implementation Tools

+ (CGSize)sizeWithText:(NSString *)text andFont:(UIFont *)font maxSize:(CGSize)maxSize
{
    NSDictionary *attrs = @{NSFontAttributeName : font};
    return [text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}
@end
